package com.yztc.yidoutang.fragment.sousuo_fragment;

import com.yztc.yidoutang.bean.HotSearchBean;

import java.util.List;

import rx.Subscriber;

/**
 * Created by My on 2016/10/18.
 */

public class SouSuoPresenter implements SouSuoContract.Presenter{
    private SouSuoContract.View view;
    private SouSuoContract.Model model;

    public SouSuoPresenter(SouSuoContract.View view) {
        this.view = view;
        this.model=new SouSuoModel();
    }

    @Override
    public void getHotSearchData() {
        model.getHotSearchData(new Subscriber<HotSearchBean>() {
            @Override
            public void onCompleted() {

            }

            @Override
            public void onError(Throwable e) {

            }

            @Override
            public void onNext(HotSearchBean hotSearchBean) {
                List<String> hotSearchList=hotSearchBean.getData();
                view.onGetHotSearchSuccess(hotSearchList);
            }
        });
    }
}
